﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

using EnvironmentalMonitor.Support.Business.Environmental;
using EnvironmentalMonitor.Support.Business;
using EnvironmentalMonitor.Support.Module;
using EnvironmentalMonitor.Support.Resource;

namespace EnvironmentalMonitor.WebApplication.Environmental.Detector
{
    public partial class DeleteJson : EnvironmentalMonitor.WebApplication.Abstract.AbstractSaveJson
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            const string GUID = "guid";
            DateTime now = DateTime.Now;

            EnvironmentalMonitor.Support.Module.Environmental.Detector module = new Support.Module.Environmental.Detector();
            module.Guid = this.ParameterString(GUID);

            this.SaveJsonData = new Abstract.SaveJsonData();
            DetectorBusiness business = new DetectorBusiness();
            this.SaveJsonData.success = business.Delete(module);
            if (this.SaveJsonData.success)
            {
                this.SaveJsonData.msg = "删除操作成功！";
            }
            else
            {
                this.SaveJsonData.msg = "删除操作失败！";
            }

            string json = this.Json();

            this.Response.Write(json);
            this.Response.Flush();
            this.Response.End();
        }
    }
}